UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1vq9B9pvaG9z+v+nM3GFhpTnj9caP69TTGbn9mqTGSQ=' 
WHERE 
  key_id = '79a8827e5eddcb259c4f3beb26042290eea1c83c2e2e6bf0947c9dced01e78e6' 
  AND (
    token = '1vq9B9pvaG9z+v+nM3GFhpTnj9caP69TTGbn9mqTGSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050