UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z3eNopObAlSgFOdEKTfjpSQfdIkEsjJDgcxOo5dZDUI='
WHERE
key_id = '192031391e9f143ab48b95279820f33e83f0af1d100680deb50e0d2bcdf73626'
AND (
token = 'Z3eNopObAlSgFOdEKTfjpSQfdIkEsjJDgcxOo5dZDUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)