UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1YgcTk+vRqP7lMyvg0PV7RXKVbIFSpPEXFjW2G7o8G8='
WHERE
key_id = '55743515d1f2752353581b6a2ab0fb2a9d7777f748c2fde16581fd763003d22e'
AND (
token = '1YgcTk+vRqP7lMyvg0PV7RXKVbIFSpPEXFjW2G7o8G8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)