UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '67ArYan1Kxhq5TxYkJg2za6GuubkzDVX8M+V17aI01Y=' 
WHERE 
  key_id = 'cfa759641c18d2f917c90d001d8a4dbc5cc94a9798e994b988cebd59a71324dc' 
  AND (
    token = '67ArYan1Kxhq5TxYkJg2za6GuubkzDVX8M+V17aI01Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028