UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A74mfZJscmtd3mPxj/8Pq4UPJZIAHPBj4bdv5LMQj5c=' 
WHERE 
  key_id = 'a32c1dfa96cce6ff7c9781e1bfa0a9204f2d388d8ac6af6f3297b8ad7cd0e5f5' 
  AND (
    token = 'A74mfZJscmtd3mPxj/8Pq4UPJZIAHPBj4bdv5LMQj5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029