UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'toPq3S36OGe59qtf3tXet0A0SvB86GVfQ3jGg4jv5z0='
WHERE
key_id = '421af2d98e0bf5a0e473d376f83aba33340bb7ec6a989abd88183e9086e852d1'
AND (
token = 'toPq3S36OGe59qtf3tXet0A0SvB86GVfQ3jGg4jv5z0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)