UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'onAgKG9fH+IJyr9AcDsga9AliHXkkAKnqNcil8cteDM='
WHERE
key_id = '73ab360c08a95572f3a81a48fd749f52de4ccb1ef82292d3915f2a5d36f02962'
AND (
token = 'onAgKG9fH+IJyr9AcDsga9AliHXkkAKnqNcil8cteDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)