UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hJIUQTTh48CKkMIh3B12uCWoSLU6OlTDuB7QdeEeraI='
WHERE
key_id = '3ec0cc6fe48beec0846d2cc19b4c6abad23eff8c3dc5078a9da584f5d3c83736'
AND (
token = 'hJIUQTTh48CKkMIh3B12uCWoSLU6OlTDuB7QdeEeraI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)