UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KOmjPqYFw3p1S2TkgKsobA7/xH9UwFvcQPnHZj/60sE='
WHERE
key_id = 'f6d8f6b855243ef88d19ed78d303c7fa91aad151f49a3bf60454bec3b340006d'
AND (
token = 'KOmjPqYFw3p1S2TkgKsobA7/xH9UwFvcQPnHZj/60sE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)