UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '71GF7P2V3QMmd+VfsypqnmUTpPmCSYTVU74HtTIcgeg=' 
WHERE 
  key_id = 'a4aff4a12df19e9cb020fb52614c1c00ad3fc16a2dedf8068980488e725c6bb6' 
  AND (
    token = '71GF7P2V3QMmd+VfsypqnmUTpPmCSYTVU74HtTIcgeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038