UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rsptkS4s+CKLCxh42ImFy7wQbG2YMsElhKfvSTKi8b8='
WHERE
key_id = '0b86b538b26a671ae24c87b1a38a2f10261f88ade5b5e2f20a3ec3249c5f2a61'
AND (
token = 'rsptkS4s+CKLCxh42ImFy7wQbG2YMsElhKfvSTKi8b8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)