UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OZ4c5NEOozwc+PPm6QV/vRBuV1ThsTiRUS1KNC6zPoU='
WHERE
key_id = '7f27c12c6e268204d2666f026e3351e1ec1b2b551ab4be6a47eb6849ab474343'
AND (
token = 'OZ4c5NEOozwc+PPm6QV/vRBuV1ThsTiRUS1KNC6zPoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)