UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ux9A0ZMC3JgHgttybvGTNCHALHuPQiESE/nhAYiadiU=' 
WHERE 
  key_id = '2b7b04ee0abf0b50e9b1ab2ab56a7ee437b93d08c2eb6efee178658f70cebc31' 
  AND (
    token = 'Ux9A0ZMC3JgHgttybvGTNCHALHuPQiESE/nhAYiadiU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036