UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U+obfWTPNh5/+iWxLS0g5dO+o4vu5akJgRaVyo293O8='
WHERE
key_id = 'fcdf75015a2af8e8513a3c855e82ac56f76ad13e93c6aaaa5ef5df89ecb129c5'
AND (
token = 'U+obfWTPNh5/+iWxLS0g5dO+o4vu5akJgRaVyo293O8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)