UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QeGk1TOX70uP60RfwnF2gv5695nUYAR/rt66XwQOuDM=' 
WHERE 
  key_id = 'a5dc06e7eef9d2f7839b5a9eb9c482d3d7a7c9bcc731b1f43dc830e050a59445' 
  AND (
    token = 'QeGk1TOX70uP60RfwnF2gv5695nUYAR/rt66XwQOuDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052