UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7TrihEvsWn5halGp+rLpJ4WKUuI7/Vx67F7lisCSzB0=' 
WHERE 
  key_id = 'ea4baf0ea43a5d8d17fa8b70863f7e27b42bd078b3bca3b6276622f8374f39b0' 
  AND (
    token = '7TrihEvsWn5halGp+rLpJ4WKUuI7/Vx67F7lisCSzB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039