UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rL6VHmVGyUh/L+/HCMhU0GnCFwh8im4zIolzQTgXEUY='
WHERE
key_id = 'da1289298974325347d61fffe0dd07b811e0f6776803f0f863643f52d7e132ea'
AND (
token = 'rL6VHmVGyUh/L+/HCMhU0GnCFwh8im4zIolzQTgXEUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)