UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '97yGCc5mf1uDGWqGADQ8GylgAal7NimRpZxUqp9V8zw='
WHERE
key_id = 'cec878f26d9bd0b3081dce4a684d1e3ccc50485263dcd36b33f462b69e638a63'
AND (
token = '97yGCc5mf1uDGWqGADQ8GylgAal7NimRpZxUqp9V8zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)