UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PbqSEy0YKDXSX2Ke2spEyH+R2t+UnP6kdxbeSNH8av0=' 
WHERE 
  key_id = 'eba01a7ee3e4d46d0cb23b73cf4c839cdf1ae9d26f7b765a540a5b3d39538f35' 
  AND (
    token = 'PbqSEy0YKDXSX2Ke2spEyH+R2t+UnP6kdxbeSNH8av0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044