UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XPBcNdgR/BsqDmDZxHT89BRuxnmMLIGANOZVH+bOhqI=' 
WHERE 
  key_id = '72026c33c1121b73bf27a404af23792334addc6c719f7b7c2adde51e20c81b87' 
  AND (
    token = 'XPBcNdgR/BsqDmDZxHT89BRuxnmMLIGANOZVH+bOhqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039