UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kI9XkP/VxtKDbdfiB236te5N67HYqG6MhTJWcqVLf/I='
WHERE
key_id = '5cf2c5b74d1f84c18023d454082991f169cedd450c417b88f8b7b23c572b2938'
AND (
token = 'kI9XkP/VxtKDbdfiB236te5N67HYqG6MhTJWcqVLf/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)