UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2o6be2mWbUMm2Y4AfSHARGbRqrzORjR2zFmaBJs2PRg=' 
WHERE 
  key_id = '91f0192f07fbb5e0707821e9973f667464ec2f8ef88c1ebfb63bbca1752adaa7' 
  AND (
    token = '2o6be2mWbUMm2Y4AfSHARGbRqrzORjR2zFmaBJs2PRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020