UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zqMRYJGxtCoAtrmR2m2pQ8sqy7D+o5zKnU9jiuFnCNM=' 
WHERE 
  key_id = 'edff3770bf725f33eef82028aca184cdca9dc5fdb6b80af771ce39fcb47bc7b4' 
  AND (
    token = 'zqMRYJGxtCoAtrmR2m2pQ8sqy7D+o5zKnU9jiuFnCNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033