UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ta82FHU53hr9jhweoZFXJi9zIdeoxXD0XtIs9qhmmuk='
WHERE
key_id = 'da7a5d6bb4844b9349d1bbdff04e6b71c923573b06a7083576d9dc4d62d43841'
AND (
token = 'ta82FHU53hr9jhweoZFXJi9zIdeoxXD0XtIs9qhmmuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)