UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5yO9rhd1l3ki0OycvcTRWKDF/X5Fn6U2gDmDN41Y4P4='
WHERE
key_id = '0ff1fdd6159045e0ab7f4e9a17b9858c457fe0b9ffaddbbb13255c1c538ef3d0'
AND (
token = '5yO9rhd1l3ki0OycvcTRWKDF/X5Fn6U2gDmDN41Y4P4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)