UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ygEgmTKK1OUAHpz9NZ7A0XcrqCVgaQEdwH/sKS+1zJ0='
WHERE
key_id = 'feea9583d5e602fb3f69cca50ebcb33e09098d616d71fe5d55eabb6dade41efd'
AND (
token = 'ygEgmTKK1OUAHpz9NZ7A0XcrqCVgaQEdwH/sKS+1zJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)