UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AoL/Fzcw3IF7+1aP1FPio1LdvpV8hvUMGCy/qlQnRhU='
WHERE
key_id = '0e98a6a9815f32d28791f510a8946b5c921e0bafb2f658cd1e524b410276f05f'
AND (
token = 'AoL/Fzcw3IF7+1aP1FPio1LdvpV8hvUMGCy/qlQnRhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)