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