UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WikW/CAMGwYBw1OLdfxwZ1KpJVRuAfwU1BsIQ+7HQYQ=' 
WHERE 
  key_id = '6cac55426a9ea53274a86d047ab5a7903f1f6038b1b68ce3505f97f1e578ac4d' 
  AND (
    token = 'WikW/CAMGwYBw1OLdfxwZ1KpJVRuAfwU1BsIQ+7HQYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043