UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'erB3kl4bOSQ8y5JyVoPQj9WMdrq2M0StncAdwl7cAs0=' 
WHERE 
  key_id = '5bcfc99a76711bb4f183135797357bfc32b3b920dac23ef454de55e7e6cd5674' 
  AND (
    token = 'erB3kl4bOSQ8y5JyVoPQj9WMdrq2M0StncAdwl7cAs0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043