UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YUvtsW0X/yGzQCs5oi7kxs9ZFmXF+demlJU+SuF5FeY=' 
WHERE 
  key_id = '5f076ac9a59086009cd27264c46a057e439c86769eb5616fcf98bce12c40cd35' 
  AND (
    token = 'YUvtsW0X/yGzQCs5oi7kxs9ZFmXF+demlJU+SuF5FeY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023