UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2wZd6MrKOEj9LRZih70l+OZmha5NNKjquJA02YQ3EfM=' 
WHERE 
  key_id = 'd0664f9a4bf37ad0259b2a488cbda643dcc0e8eb83dabc2d8f0c482435a35a8b' 
  AND (
    token = '2wZd6MrKOEj9LRZih70l+OZmha5NNKjquJA02YQ3EfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057