UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'raozVZ5Jxrp+Y80I2bAzSVDalVdxAK1r2D+M7iYVfZ0=' 
WHERE 
  key_id = 'e1151e91aa15bd906034e95718441c103a54bb342b842edb84e524b08d43af60' 
  AND (
    token = 'raozVZ5Jxrp+Y80I2bAzSVDalVdxAK1r2D+M7iYVfZ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029