UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2NgaSSaBPj/7vFadohHTJB02BGAxBWUDKsW9gch79JI=' 
WHERE 
  key_id = '623f8267e1148608af63e9d7641b5f826e1c600ff50aaaa75a607d7a1911db3f' 
  AND (
    token = '2NgaSSaBPj/7vFadohHTJB02BGAxBWUDKsW9gch79JI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033