UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sRAK/qb68zB+sIF7qlkw9BGWBNCGjR6Lbs1lXNantBQ='
WHERE
key_id = 'dea30f32340da5a586894c61ade1fd5c0321fb4aa089af432a7bd6f1b0436add'
AND (
token = 'sRAK/qb68zB+sIF7qlkw9BGWBNCGjR6Lbs1lXNantBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)