UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HXQczW3c9uilqq+7LmgPEY7wC/PbAexHGKLzvTT71Rk='
WHERE
key_id = 'b95206da0f65eeb2476f908e099fca3f8f59502c0af64ad4540ed1ca397bd4d0'
AND (
token = 'HXQczW3c9uilqq+7LmgPEY7wC/PbAexHGKLzvTT71Rk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)