UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0d+kTY8QQEUWIzRviIRFG/d5N1nGq9pM2Z1xNW6cdlk=' 
WHERE 
  key_id = '0b2c6a5f86ba383395f672470d3ccb5f36848898f8761cb05d18b890d3c78f57' 
  AND (
    token = '0d+kTY8QQEUWIzRviIRFG/d5N1nGq9pM2Z1xNW6cdlk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027