UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pWHjV0rI91/OdSHzVyb9VI/zytV4hr3WvvYIoTVIF+M=' 
WHERE 
  key_id = '6bb942d898d90d1d203bd4f053f5db867b3c0d7cdb66772f2e440f35d94c2b9b' 
  AND (
    token = 'pWHjV0rI91/OdSHzVyb9VI/zytV4hr3WvvYIoTVIF+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033